class AllFilters {

  def filters = {
    authenticated(controller: "post", action: "edit") {
      before = {
        if (!session.user) {
          redirect(controller: "user", action: "login")
          return false
        }
      }
    }

    tags(controller: "*", action: "*") {
      after = {model ->
        model?.tags = Tag.list()
      }
    }

    blogConfig(controller: "*", action: "*") {
      after = {model ->
        model?.blogConfig = BlogConfig.list()[0]
      }
    }
  }
}